<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>登录</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <link rel="stylesheet" href="css/style.css" />

<body>

<div class="login-container">
    <h1>安时利医疗有限公司</h1>

    <div class="connect">
        <p>www.angy.cn</p>
    </div>


    <div>
        <input type="text" id="username" name="caccount" class="username" placeholder="用户名" autocomplete="off"/>
    </div>
    <div>
        <input type="password" id="password" name="cpass" class="password" placeholder="密码" oncontextmenu="return false" onpaste="return false" />
    </div>
    <div>
        <button id="bt">登 录</button>
    </div>

    <a href="jumpRegist">
        <button type="button" class="register-tis">还有没有账号？</button>
    </a><br><br>
    <span color="red"></span>

</div>

<script src="js/jquery.min.js"></script>
<script src="js/common.js"></script>
<!--背景图片自动更换-->
<script src="js/supersized.3.2.7.min.js"></script>
<script src="js/supersized-init.js"></script>
<!--表单验证-->
<script src="js/jquery.validate.min.js?var1.14.0"></script>
<script type="text/javascript">

    $("#bt").click(function () {

        if("" == $("#username").val() || "" == $("#password").val()){
            alert("用户名或密码不能为空")
        }else {
            $.ajax({
                url:"login",
                data:{"uname":$("#username").val(),"upass":$("#password").val()},
                type:"post",
                success:function (result) {

                    if(result.result == '0002'){

                        $("span").html("用户名或密码错误");

                    }else if(result.result == '0000'){

                        window.location.href="index";

                    }

                }
            });
        }

    });

</script>

</body>
</html>